package com.bite.libraries.dao;

import com.bite.libraries.model.BookInfo;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class BookDao {
    public List<BookInfo> mockData(){
        //理论上应该从数据库中获取，这个只为模拟
        List<BookInfo> bookInfos = new ArrayList<>();
        for (int i = 1; i <= 15; i++) {
            BookInfo bookInfo = new BookInfo();
            bookInfo.setId(i);
            bookInfo.setBookName("小仵日记"+i);
            bookInfo.setAuthor("贺宇飞"+i);
            bookInfo.setNum(i*2+1);
            bookInfo.setPrice(new BigDecimal(i*3));
            bookInfo.setPublishName("小仵出版社"+i);
            if (i%5 == 0){
                bookInfo.setStatus(2);
//                bookInfo.setStatusCN("不可借阅");
            }else {
                bookInfo.setStatus(1);
//                bookInfo.setStatusCN("可借阅");
            }
            bookInfos.add(bookInfo);
        }
        return bookInfos;
    }
}
